rm(list= ls())

library(tidyverse)

## Load Data

dat <- readRDS('data/mp_data.rds') %>%
  filter(elecper != 8) %>%
  distinct(mp_id, .keep_all = T) ## remove duplicates 

## Histogram of year of birth

ggplot(dat, aes(x = year_birth)) + 
  geom_histogram(binwidth = 1, col = 'black') + 
  theme_bw() +
  geom_vline(xintercept = median(dat$year_birth), linetype = 'dotted') + 
  labs(x = 'Year of birth',
       y = 'Number of MPs in dataset') + 
  scale_x_continuous(breaks = seq(1880, 1935, 10))


